<?php
/**
 * @auther:周卫星
 * @date:2019/11/4
 * @fileName:sgc.blade.php
 * @fileDesc:  菜品分类列表
 */
?>

@extends('biz.layout.biz_layout')
@section('title', '菜品管理-菜品列表')
@push('css')
    <style>
        .table_list{height: 100px; border: 1px solid #ddd; text-align: center; margin-left: 10px;margin-bottom: 10px;line-height: 100px;cursor: pointer;display: inline-block;border-radius: 4px;box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4);}
        .table-grid-title {
            height: 120px;
            width: 120px;
            line-height: 120px;
            text-align: center;
        }
    </style>
@endpush

@push('js')
    <script src="{{ Illuminate\Support\Facades\URL::asset('js/biz/goods/sgc.js') }}"></script>
@endpush

@section('content')
    <div class="layui-btn-container">
        <button type="button" class="layui-btn layui-btn-normal" id="addStoreGoodsClassBtn">添加分类</button>
    </div>
    <table id="goodsList" lay-filter="goodsList">
        {{-- 操作 --}}
        <script id="operation" type="text/html">
            <div class="layui-btn-container">
                <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" data-id="@{{ d.sgc_id }}" lay-event="edit">修改</button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" data-id="@{{ d.sgc_id }}" lay-event="del">删除</button>
            </div>
        </script>
    </table>
    {{-- 添加分类 --}}
    <div class="layui-fluid" id="addStoreGoodsClassDiv" style="display: none;">
        <div class="layui-form">
            <form action="" class="layui-form">
                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                <div class="layui-form-item">
                    <label class="layui-form-label">分类名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="sgc_name" required  lay-verify="required" placeholder="请输入分类名称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">权重</label>
                    <div class="layui-input-block">
                        <input type="text" name="sgc_sort" required  lay-verify="required" placeholder="请输入分类权重" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="addStoreGoodsClass">添加</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    {{-- 修改分类 --}}
    <div class="layui-fluid" id="editStoreGoodsClassDiv" style="display: none;">
        <div class="layui-form">
            <form action="" class="layui-form" lay-filter="editStoreClass">
                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                <input type="hidden" name="id">
                <div class="layui-form-item">
                    <label class="layui-form-label">分类名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="sgc_name" required  lay-verify="required" placeholder="请输入分类名称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">权重</label>
                    <div class="layui-input-block">
                        <input type="text" name="sgc_sort" required  lay-verify="required" placeholder="请输入分类权重" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="editStoreGoodsClass">添加</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection
